import {createRouter, createWebHistory} from 'vue-router';
import {qiankunWindow} from 'vite-plugin-qiankun/dist/helper';
import HomeView from '../views/HomeView.vue';

const router = createRouter({
  // history: createWebHistory(import.meta.env.BASE_URL),
  history: createWebHistory(qiankunWindow.__POWERED_BY_QIANKUN__ ? '/base-app/' : '/'),
  routes: [
    {
      name: 'BaseHome',
      path: '/home',
      component: HomeView,
    },
    {
      name: 'BaseAbout',
      path: '/about',
      component: () => import('../views/AboutView.vue'),
    },
  ],
});

export default router;
